package com.ruoyi.web.controller.vantController.teamController;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.system.domain.construction.QualifiPicInfo;
import com.ruoyi.system.domain.construction.Team;
import com.ruoyi.system.domain.vo.ApiBuildingVo;
import com.ruoyi.system.domain.zhuangxiumain.shopMain.BrandInfo;
import com.ruoyi.system.service.construction.QualifiPicInfoService;
import com.ruoyi.system.service.vantservice.teamservice.ApiBuildingVoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import io.swagger.models.auth.In;
import org.aspectj.weaver.loadtime.Aj;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
@Api(value = "建房施工信息接口", tags = {"建房施工信息接口"})
@RestController
@RequestMapping("/api/team/building")
@CrossOrigin
public class ApiBuildingVoController extends BaseController {

    @Autowired(required = false)
    private ApiBuildingVoService apiBuildingVoService;

    @Autowired
    private QualifiPicInfoService qualifiPicInfoService;

    @GetMapping(value ="/findAllRongIdOne/{supplierId}")
    public List<QualifiPicInfo> findAllRongIdOne(@PathVariable("supplierId") Integer supplierId){
        List<QualifiPicInfo> list = qualifiPicInfoService.findAllRongId(supplierId);
        return list;
    }

    @GetMapping(value ="/findAllRongIdTwoen/{supplierId}")
    public List<QualifiPicInfo> findAllRongIdTwoen(@PathVariable("supplierId") Integer supplierId){
        List<QualifiPicInfo> list = qualifiPicInfoService.findAllRongIdTwoen(supplierId);
        return list;
    }

    @GetMapping(value ="/findAllRongIdThree/{supplierId}")
    public List<QualifiPicInfo> findAllRongIdThree(@PathVariable("supplierId") Integer supplierId){
        List<QualifiPicInfo> list = qualifiPicInfoService.findAllRongIdThree(supplierId);
        return list;
    }


    @GetMapping(value ="/findAllRongIdTwo/{supplierId}")
    public AjaxResult findAllRongIdTwo(@PathVariable("supplierId") Integer supplierId){
        return AjaxResult.success(qualifiPicInfoService.findAllRongIdTwo(supplierId));
    }

    @ApiResponses({@ApiResponse(code = 200, message = "正常", response = BrandInfo.class)})
    @ApiOperation(value = "建房施工全部信息接口")
    @GetMapping(value ="/findAllList")
    public TableDataInfo findAllList(ApiBuildingVo apiBuildingVo){
        startPage();
        List<ApiBuildingVo> allList = apiBuildingVoService.findAllList(apiBuildingVo);
        return getDataTable(allList);
    }

    @ApiOperation(value = "装修施工全部信息接口")
    @GetMapping(value ="/findAllListTwo")
    public TableDataInfo findAllListTwo(ApiBuildingVo apiBuildingVo){
        startPage();
        List<ApiBuildingVo> allList = apiBuildingVoService.findAllListTwo(apiBuildingVo);
        return getDataTable(allList);
    }

@   ApiOperation(value = "同城安装全部信息接口")
    @GetMapping(value ="/findAllListTwoTong")
    public TableDataInfo findAllListTwoTong(ApiBuildingVo apiBuildingVo){
        startPage();
        List<ApiBuildingVo> allList = apiBuildingVoService.findAllListTwoTong(apiBuildingVo);
        return getDataTable(allList);
    }

    @GetMapping(value = "/zhuangxiuList")
    public List<Team> zhuangxiuList(Team team){
        List<Team> teams = apiBuildingVoService.zhuangxiuList(team);
        return teams;
    }

    @GetMapping(value = "/tongchengList")
    public List<Team> tongchengList(Team team){
        List<Team> teams = apiBuildingVoService.tongchengList(team);
        return teams;
    }



    @GetMapping(value = "/jianfangList")
    public List<Team> jianfangList(Team team){
        List<Team> teams = apiBuildingVoService.jianfangList(team);
        return teams;
    }

    @GetMapping(value ="/teamNameJian/{teamName}")
    public List<ApiBuildingVo> teamNameJian(@PathVariable("teamName") String teamName){
        List<ApiBuildingVo> teamNamea = apiBuildingVoService.teamNameJian(teamName);
        return teamNamea;
    }


    @GetMapping(value ="/teamNameZhuang/{teamName}")
    public List<ApiBuildingVo> teamNameZhuang(@PathVariable("teamName") String teamName){
        List<ApiBuildingVo> teamNamea = apiBuildingVoService.teamNameZhuang(teamName);
        return teamNamea;
    }
    @GetMapping(value ="/teamNameZhuangTong/{teamName}")
    public List<ApiBuildingVo> teamNameZhuangTong(@PathVariable("teamName") String teamName){
        List<ApiBuildingVo> teamNamea = apiBuildingVoService.teamNameZhuangTong(teamName);
        return teamNamea;
    }


    @GetMapping(value ="/findAlladdres/{address}")
    public List<ApiBuildingVo> findAlladdres(@PathVariable("address") String address){
        List<ApiBuildingVo> alladdres = apiBuildingVoService.findAlladdres(address);
        return alladdres;
    }
    @GetMapping(value ="/findAllListAlladdres/{address}")
    public List<ApiBuildingVo> findAllListAlladdres(@PathVariable("address") String address){
        List<ApiBuildingVo> alladdres = apiBuildingVoService.findAllListAlladdres(address);
        return alladdres;
    }


    @ApiResponses({@ApiResponse(code = 200, message = "正常", response = BrandInfo.class)})
    @ApiOperation(value = "建房施工通过ID查询接口")
    @GetMapping(value ="/findAllById/{constructionId}")
    public AjaxResult findAllListById(@PathVariable("constructionId") Long constructionId){
        return AjaxResult.success(apiBuildingVoService.findAllById(constructionId));
    }

    @ApiResponses({@ApiResponse(code = 200, message = "正常", response = BrandInfo.class)})
    @ApiOperation(value = "建房施工案例通过ID查询接口")
    @GetMapping(value ="/getIdList/{constructionId}")
    public AjaxResult getIdList(@PathVariable("constructionId") Long constructionId){
        return AjaxResult.success(apiBuildingVoService.getIdList(constructionId));
    }


    @ApiResponses({@ApiResponse(code = 200, message = "正常", response = BrandInfo.class)})
    @ApiOperation(value = "建房施工详情查询")
    @GetMapping(value ="/findAllListDetails")
    public TableDataInfo findAllListDetails(ApiBuildingVo apiBuildingVo){
        startPage();
        List<ApiBuildingVo> allList = apiBuildingVoService.findAllListDetails(apiBuildingVo);
        return getDataTable(allList);
    }


    @ApiResponses({@ApiResponse(code = 200, message = "正常", response = BrandInfo.class)})
    @ApiOperation(value = "建房施工通过ID查询接口")
    @GetMapping(value ="/getDetailsId/{constructionId}")
    public AjaxResult getDetailsId(@PathVariable("constructionId") Long constructionId){
        return AjaxResult.success(apiBuildingVoService.getDetailsId(constructionId));
    }

    /**
     * 施工队图片轮播
     * @param constructionId
     * @return
     */
    @PostMapping("/selectCpiUrl/{constructionId}")
    public AjaxResult cpiUrl(@PathVariable("constructionId")Integer constructionId){
        return AjaxResult.success(apiBuildingVoService.selectCpiUrl(constructionId));
    }


}
